package cn.powerone.scm.service.impl;

import java.util.List;
import cn.powerone.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.powerone.scm.mapper.ScmStatsSupplierYearlyMapper;
import cn.powerone.scm.domain.ScmStatsSupplierYearly;
import cn.powerone.scm.service.IScmStatsSupplierYearlyService;

/**
 * 供应商年度统计信息Service业务层处理
 * 
 * @author PowerOne
 * @date 2025-09-09
 */
@Service
public class ScmStatsSupplierYearlyServiceImpl implements IScmStatsSupplierYearlyService 
{
    @Autowired
    private ScmStatsSupplierYearlyMapper scmStatsSupplierYearlyMapper;

    /**
     * 查询供应商年度统计信息
     * 
     * @param id 供应商年度统计信息主键
     * @return 供应商年度统计信息
     */
    @Override
    public ScmStatsSupplierYearly selectScmStatsSupplierYearlyById(Long id)
    {
        return scmStatsSupplierYearlyMapper.selectScmStatsSupplierYearlyById(id);
    }

    /**
     * 查询供应商年度统计信息列表
     * 
     * @param scmStatsSupplierYearly 供应商年度统计信息
     * @return 供应商年度统计信息
     */
    @Override
    public List<ScmStatsSupplierYearly> selectScmStatsSupplierYearlyList(ScmStatsSupplierYearly scmStatsSupplierYearly)
    {
        return scmStatsSupplierYearlyMapper.selectScmStatsSupplierYearlyList(scmStatsSupplierYearly);
    }

    /**
     * 新增供应商年度统计信息
     * 
     * @param scmStatsSupplierYearly 供应商年度统计信息
     * @return 结果
     */
    @Override
    public int insertScmStatsSupplierYearly(ScmStatsSupplierYearly scmStatsSupplierYearly)
    {
        scmStatsSupplierYearly.setCreateTime(DateUtils.getNowDate());
        return scmStatsSupplierYearlyMapper.insertScmStatsSupplierYearly(scmStatsSupplierYearly);
    }

    /**
     * 修改供应商年度统计信息
     * 
     * @param scmStatsSupplierYearly 供应商年度统计信息
     * @return 结果
     */
    @Override
    public int updateScmStatsSupplierYearly(ScmStatsSupplierYearly scmStatsSupplierYearly)
    {
        scmStatsSupplierYearly.setUpdateTime(DateUtils.getNowDate());
        return scmStatsSupplierYearlyMapper.updateScmStatsSupplierYearly(scmStatsSupplierYearly);
    }

    /**
     * 批量删除供应商年度统计信息
     * 
     * @param ids 需要删除的供应商年度统计信息主键
     * @return 结果
     */
    @Override
    public int deleteScmStatsSupplierYearlyByIds(Long[] ids)
    {
        return scmStatsSupplierYearlyMapper.deleteScmStatsSupplierYearlyByIds(ids);
    }

    /**
     * 删除供应商年度统计信息信息
     * 
     * @param id 供应商年度统计信息主键
     * @return 结果
     */
    @Override
    public int deleteScmStatsSupplierYearlyById(Long id)
    {
        return scmStatsSupplierYearlyMapper.deleteScmStatsSupplierYearlyById(id);
    }
}
